package com.zbkj.common.request.traceability;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 可追溯项请求对象
 * +----------------------------------------------------------------------
 * | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
 * +----------------------------------------------------------------------
 * | Author: xiaolic
 * +----------------------------------------------------------------------
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="TraceableItemsRequest对象", description="可追溯项请求参数")
public class TraceableItemsRequest implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "可追溯项ID，编辑时必传")
    private Long id;

    @ApiModelProperty(value = "所属批次ID", required = true)
    @NotNull(message = "所属批次ID不能为空")
    private Long batchId;

    @ApiModelProperty(value = "当前号码/序列号 (批次内)", required = true)
    @NotNull(message = "序列号不能为空")
    private Long serialNumber;

    @ApiModelProperty(value = "生产日期/出生日期 (可独立于批次)")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date productionDate;
}
